(*
 *
 *)

module type SigEnv =
  sig
    type ('a,'b) t
    exception KNE
 
    val emptyenv: ('a,'b) t
    val isemptyenv : ('a,'b) t -> bool
    val addenv : 'a * 'b -> ('a,'b) t -> ('a,'b) t
    val addenvlist: 'a * 'b list -> ('a,'b) t
    val isindom : 'a -> ('a,'b) t -> bool
    val valinenv : 'a -> ('a,'b) t -> 'b
  end

module Env(MyMap: SigMap) : SigEnv =
  struct
    type ('a,'b) t = ('a, 'b) MyMap.t
    exception KNE


    let emptyenv = MyMap.createmap

    let isemptyenv e = MyMap.isempty e

    let addenv (k,v) e = MyMap.addmap (k,v) e
    
    let rec addenvlist kvl e =
       match kvl with
         [] -> e
       | h::t -> let e1 = addenv h e
                 in addenvlist t e1

    let isindom k e = MyMap.isinmap k e

    let valinenv k e = MyMap.lookupmap k e
  end

